using UnityEngine;
using System.Collections;
using UnityEditor;

[CustomEditor(typeof(Tile))]
public class TileEditor : Editor {

	// Use this for initialization
	void Start () {
	
	}
	
	public override void OnInspectorGUI()
	{
		DrawDefaultInspector();
		
		if(Selection.gameObjects[0] != null)
		{
			Pincel pincel = (Pincel) GameObject.FindObjectOfType(typeof(Pincel));
			
			( (Tile) target).renderer.material = pincel.textura;
		}	
	}
	
	// Update is called once per frame
	void Update () {
	
	}
}
